<%--
 *  File:    AgreementConfigMain.jsp
 *  @Author: DC
 *  Date:    2011/09/13
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ page import="java.text.*" %>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>



<% //--------------------------------------  setting logger --%>
<%
  Category cat = Category.getInstance("jsp.NewDeliveryMain");
  //init param
  String strModuleName = "CRM";
  String privilegeCode = "11203";
  String contextPath = request.getContextPath();  
  
  
  
  
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<PageFlow:CheckPageFlow pageName="p_agreementconfigmain"/>
<%--@ include file="/inc/CatchError.inc" --%>
<%
	//params
   String viewflag = "";

     if(pageContext.getAttribute("viewflag") != null&&((String)pageContext.getAttribute("viewflag")).equals("view")) {

           viewflag = "view";
     }

    
    String strIsDefault = null;
	String paraIsDefault = "";
	String isTdNeed = "td-text";
	if("Y".equals(request.getParameter("isdefault"))) {
		strIsDefault = "&isdefault=Y";
		paraIsDefault = "Y";
		isTdNeed = "need";
	}else if ("N".equals(request.getParameter("isdefault"))) {
		strIsDefault = "&isdefault=N";
		paraIsDefault = "N";
	}
  String isNew = request.getParameter("isNew");
  if("Y".equals(request.getParameter("isNew"))) {
		isNew = "Y";
	}else if ("N".equals(request.getParameter("isNew"))) {
		isNew = "N";
	}else  {
		isNew = null;
	}
  //System.out.println("main---------------------------------"+isNew);
  String isEdit=request.getParameter("isEdit");
  //out.print(isEdit);
  if("Y".equals(request.getParameter("isEdit"))) {
	  isEdit = "Y";
	}else if ("N".equals(request.getParameter("isEdit"))) {
		isEdit = "N";
	}else  {
		isEdit = null;
	}
  
  //System.out.println("main************************"+isEdit);
  //params end
  
  HashMap zmylagreementconfiginfo = null;
  String valuezmylagreementconfigid = null;
  String dateOpt = null;
  zmylagreementconfiginfo = (HashMap)pageContext.getAttribute("zmylagreementconfiginfo");
	  if(zmylagreementconfiginfo != null&&zmylagreementconfiginfo.size()!=0) {
  		if(isNew!=null && isNew.equals("Y")){
  			//if(isEdit!=null && isEdit.equals("Y")){
		  valuezmylagreementconfigid = JspHelper.filterNull( zmylagreementconfiginfo.get("zmylagreementconfigid") ).toString();
	  	  // }
  		}
		dateOpt = JspHelper.filterNull( zmylagreementconfiginfo.get("createdate") ).toString();
      }else {
	  	  zmylagreementconfiginfo = new HashMap();
		  zmylagreementconfiginfo.put("status",new Integer(10));
		  zmylagreementconfiginfo.put("createdate",new java.sql.Date(System.currentTimeMillis()));
		  pageContext.setAttribute("zmylagreementconfiginfo",zmylagreementconfiginfo);
		  valuezmylagreementconfigid = "";
		  zmylagreementconfiginfo = (HashMap)pageContext.getAttribute("zmylagreementconfiginfo");
      }
  HashMap userinfo = (HashMap)session.getAttribute("userinfo");


     int v_status = 10;

     if(zmylagreementconfiginfo.get("status") != null) {

           v_status = ((Integer)zmylagreementconfiginfo.get("status")).intValue();
     } 
     
     
     String strIsNew = "no";
     String isbuyerchaintype = ""; 
     String isbuyerchaintypeChecked="";
     String issellerchaintype = ""; 
     String issellerchaintypeChecked="";
     Object obj;
     
     
     obj = zmylagreementconfiginfo.get("isbuyerchaintype");
     if ( obj != null )  isbuyerchaintype = obj.toString();    
     if ( isbuyerchaintype != null && isbuyerchaintype.equals("Y") ) 
    	 isbuyerchaintypeChecked = "checked";
     
     
     obj = zmylagreementconfiginfo.get("issellerchaintype");
     if ( obj != null )  issellerchaintype = obj.toString();    
     if ( issellerchaintype != null && issellerchaintype.equals("Y") ) 
    	 issellerchaintypeChecked = "checked";
   
     cat.debug("The isbuyerchaintype is :" + isbuyerchaintype);
     cat.debug("The issellerchaintype is :" + issellerchaintype);
     
     
 	String dateFormat = (String)session.getAttribute("dateformat");
	if(dateFormat==null)dateFormat = "yyyy-MM-dd";
%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/ScriptLib.js"></script>
<%@ include file ="/inc/NewCalendar.inc" %>
<script language="JavaScript">




function changeStatus()
{
  if(cform.status1.value == -1)
  {
	  cform.valuename.value = " ";
  }
  else
  {
	 // alert("status1 : " + cform.status1.value);
    for (i = 0; i < cform.status1.options.length; ++i)
    {
      var opt = cform.status1.options[i];
      if (opt.selected)
      {
    	  cform.valuename.value = opt.text;
      }
    }
  }
}

function changeProcessType()
{
  if(cform.processtype.value == -1)
  {
	  cform.groupname.value = " ";
  }
  else
  {
    for (i = 0; i < cform.processtype.options.length; ++i)
    {
      var opt = cform.processtype.options[i];
      if (opt.selected)
      {
    	  cform.groupname.value = opt.text;
      }
    }
  }
}

function page_save()
{	
	if(!checkForm(cform))   return;
	//emptyToNull(document.cform);
	/*if(isEmpty(cform.processname.value)) {
		alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_zmylagreementconfigName",false)) %>");
		return;
	}
	if(isEmpty(cform.status.value)) {
		alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_Status",false)) %>");
		return;
	}

	if( "Y" == "<%=paraIsDefault%>") {
		if(isEmpty(cform.processtype.value)) {
		alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_Type",false)) %>");
		return;
		}
	}*/
	<%if("Y"!=isEdit){%>
	if (toDate(cform.startdate.value, '<%= session.getAttribute("dateformat") %>') > toDate(cform.expiredate.value, '<%= session.getAttribute("dateformat") %>')) {
          alert("<%= message.getMessageDesc("AgreementConfig_StartDate_Later_Than_Expiredate") %>");
         document.cform.startdate.focus();
     return;
     }
	<%}%>
	var frm = document.cform;
	frm.actionname.value = "save";
	frm.target = "_parent";
	frm.submit();
}

function page_submit()
{
	if(!checkForm(cform))   return;

   if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE") %>") )  return;
	var frm = document.cform;
	frm.actionname.value = "submit";
	frm.target = "_parent";
	frm.submit();
}
function page_back()
{  
  parent.location.href = "AgreementConfigSummary.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode%><%=JspHelper.filterNull( strIsDefault )%>";
}

function page_selectaction()
{
  var zmylagreementconfigid = document.cform.zmylagreementconfigid.value;
  if(zmylagreementconfigid==null || zmylagreementconfigid==""){
     alert("<%= message.getMessageDesc("SAVE_INFO_FIRST") %>");
     return;
  }
  if(popwindow!=null)
    popwindow.close();
  var zmylagreementconfigid = document.cform.zmylagreementconfigid.value;
  popwindow = window.open('<%=contextPath%>/devlop/sfe/VisitProcess4CustomerType.jsp?maxitem=12&languagecode=<%= strLanguageCode%>&<%= OvalTools.randomURL() %>&zmylagreementconfigid='+zmylagreementconfigid,'newwindow', 'height=400, width=850,top=150,left=300,toolbar=n0, menubar=no, scrollbars=auto, resizable=yes, location=no, status=no');
}

function set_orgNameByPopWindow(id,code,name){

     idObj=document.getElementById("zmylprodgroupid");
    nameObj=document.getElementById("prodgroupname");

	nameObj.value=name;
	idObj.value=id;

}
function popWindowsContactProd(){


    if(popwindow!=null) popwindow.close();
 	popwindow = window.open("../../masterdata/ogm/ProductbrandPopWindow.jsp?<%= OvalTools.randomURL() %>", "newwindow", "height=400, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=yes")


 	//window.open("contactProdPopWindow.jsp?<%= OvalTools.randomURL() %>&isbottom=1&employeeid=<custom:write name="emplinfo" property="employeeid"/>", "newwindow", "height=400, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no")
}

function   cleanid(){

     idObj=document.getElementById("zmylprodgroupid");
    nameObj=document.getElementById("prodgroupname");

    if (isEmpty(nameObj.value)){
        idObj.value=" ";
    }

}

function popWindowsChain(objecttypename){
	 var   objecttype = 1;
    if (objecttypename == "seller"){
           objecttype = 1;
    }else{
          objecttype = 2;
    }
    <%	if(v_status == 10){%>
    var url = "AgreementConfigChainPop.jsp?"+"<%= OvalTools.randomURL() %>"+"&viewflag=<%=viewflag%>&objecttype="+objecttype+"&zmylagreementconfigid=<custom:write name ="zmylagreementconfiginfo" property="zmylagreementconfigid"/>";

    <%}else{%>
    var url = "AgreementConfigChainPop.jsp?"+"<%= OvalTools.randomURL() %>"+"&viewflag=view&objecttype="+objecttype+"&zmylagreementconfigid=<custom:write name ="zmylagreementconfiginfo" property="zmylagreementconfigid"/>";
    <%}%>
    var windowAttribute = "height=400, width=600,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
	if(popwindow!=null) popwindow.close();
 	popwindow = window.open(url,null,windowAttribute);


 	//window.open("contactProdPopWindow.jsp?<%= OvalTools.randomURL() %>&isbottom=1&employeeid=<custom:write name="emplinfo" property="employeeid"/>", "newwindow", "height=400, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no")
}


function checkboxValue(checkboxName)
{

   
   
   var obj = eval("document.cform." + checkboxName);
   if ( obj.value == "N" || obj.value == "" )  
   {
   obj.value = "Y"; 
   }
   else  
   {
   obj.value = "N";
   }


 /* */
	 /*  var othercheckboxName;
	  if(checkboxName=="issellerchaintype"){
		  othercheckboxName="isbuyerchaintype";
		  var isusr0=document.cform.isusr0;
		  var isusr1=document.cform.isusr1;
	  }else{
		  othercheckboxName="issellerchaintype";
		  var isusr0=document.cform.isusr1;
		  var isusr1=document.cform.isusr0;
	  }
	   var frm = document.cform;
	   var obj = eval("document.cform." + checkboxName);
	   var obj1 = eval("document.cform." + othercheckboxName);
	   
	   if ( isusr0.checked==true)  
	   {
	      obj.value = "Y"; 
	      obj1.value = "N"; 
	      isusr0.checked=true;
	      isusr1.checked=false;
	   }
	   else  
	   {
	      obj.value = "N";
	      obj1.value = "Y";
	      isusr0.checked=false;
	      isusr1.checked=true;
	   }
*/
	  
}


</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
   <form name="cform" method="post" action="../../Dispatcher">
      <input type="hidden" name="pagename" value="p_agreementconfigmain">
      <input type="hidden" name="actionname">

      <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
	  <input type="hidden" name="isNew" value="<%= isNew %>">
	   <input type="hidden" name="isEdit" value="<%= isEdit %>">
	  <%if(isNew!=null && isNew.equals("Y")) { %>
	  	<input type="hidden" name="createdate" value="<%= OvalTools.getDate() %>">
	  	<custom:hidden name="userinfo" property="userid" scope="session" changedName="maker" />
	  		<custom:hidden name="userinfo" property="orgid" scope="session"  />
      
	  <%}%>
	  	 
      <input type="hidden" name="isdefault" value="<%= paraIsDefault %>">
      <custom:hidden name ="zmylagreementconfiginfo" property="zmylagreementconfigid"/>
      
      <custom:hidden name="userinfo" property="orgname" scope="session" changedName="sellername" />
      <custom:hidden property="viewflag"/>


    <tr>
      <td valign="top">
        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">
            
           
           <tr>
            <td colspan="4" class="deepblue-left" height="22"> <img src="../../images/<%= strLanguageCode %>/quote.gif">
            &nbsp;</td>
          </tr>
           <%	if(viewflag.equals("view") || v_status == 41){%>
          <tr>

          <td class="td-text" width="110" ><%= label.getLabelName("L_ZMYLAgreementConfigCode") + label.getLabelName("L_Colon") %></td>
          	<td>
				<% if ("Y".equals(isEdit)){ %>
                  <custom:text   name="zmylagreementconfiginfo" property="agreementconfigcode" />
				<%}else{ %>
				<custom:write   name="zmylagreementconfiginfo" property="agreementconfigcode" />
				<%} %>
               </td>
             <td class="td-text" width="110" ><%= label.getLabelName("L_ZMYLAgreementConfigName") + label.getLabelName("L_Colon") %></td>
            <td>
            <% if ("Y".equals(isEdit)){ %>
				<custom:text  name="zmylagreementconfiginfo" property="agreementconfigname"  />
			<%}else{ %>	
			    <custom:write  name="zmylagreementconfiginfo" property="agreementconfigname"  />
			<%} %>
           	</td>
          </tr>

          <tr>

           	<td  class="td-text" width="110" ><%= label.getLabelName("L_ZMYLFirstOrgType") + label.getLabelName("L_Colon") %></td>
           	<td>
				   <custom:selectdic disabled="true" name="zmylagreementconfiginfo" property="sellertype" defaultValue="----ALL-----" defaultValueCost="99" dictType="BuyerType" command="notnull" label="L_ZMYLFirstOrgType" />
            </td>
            <td class="td-text" width="110" ><%= label.getLabelName("L_ZMYLSecondOrgType") + label.getLabelName("L_Colon") %></td>
            <td>
                <custom:selectdic disabled="true" name="zmylagreementconfiginfo" property="buyertype" defaultValue="----ALL-----" defaultValueCost="99" dictType="BuyerType" command="notnull" label="L_ZMYLFirstOrgType" />
            </td>

          </tr>

            <tr>

               <td class="td-text"  width="110" ><%= label.getLabelName("L_FirstOrg")+label.getLabelName("L_Chain") +label.getLabelName("L_Type") + label.getLabelName("L_Colon") %></td>
           	<td>
           	<!-- 
				    <a onclick="popWindowsChain('seller')">
               <custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
           	 -->
           	  <input type="checkbox"  disabled="true" name="isusr0" <%=JspHelper.filterNull( issellerchaintypeChecked )%> class="normalradio"  
                   onclick="javascript:checkboxValue('issellerchaintype')">
            </td>
                      <% if ( strIsNew.equalsIgnoreCase("no") ) 
             { %>
              <input type="hidden"  name="issellerchaintype" value="<%=JspHelper.filterNull( issellerchaintype )%>">
          <% }
             else
             { %>
              <input type="hidden" name="issellerchaintype" value="N">
          <% } %> 

            <td class="td-text"  width="110" ><%= label.getLabelName("L_SecondOrg")+label.getLabelName("L_Chain") +label.getLabelName("L_Type")  + label.getLabelName("L_Colon") %></td>
            <td>
            <!-- 
                  <a onclick="popWindowsChain('buyer')">
               <custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
             -->
                        	             <input type="checkbox" disabled="true" name="isusr1" <%=JspHelper.filterNull( isbuyerchaintypeChecked )%> class="normalradio"  
                   onclick="javascript:checkboxValue('isbuyerchaintype')" >
            </td>
                      <% if ( strIsNew.equalsIgnoreCase("no") ) 
             { %>
              <input type="hidden"  name="isbuyerchaintype" value="<%=JspHelper.filterNull( isbuyerchaintype )%>">
          <% }
             else
             { %>
              <input type="hidden" name="isbuyerchaintype" value="N">
          <% } %> 

          </tr>

          <tr>
          
           	<td  class="td-text" width="110" ><%= label.getLabelName("L_ZMYLStartDate") + label.getLabelName("L_Colon") %></td>
           	<td>
                 <custom:write  property = "startdate" name="zmylagreementconfiginfo"    dataType="date" dataFormatName="dateformat"/>

           	</td>
            <td class="td-text" width="110" ><%= label.getLabelName("L_ZMYLExpireDate") + label.getLabelName("L_Colon") %></td>
            <td>
                <custom:write  property = "expiredate" name="zmylagreementconfiginfo"    dataType="date" dataFormatName="dateformat"/>

            </td>

          </tr>

          <tr>

           	<td class="td-text" width="110" ><%= label.getLabelName("L_CreateTime") + label.getLabelName("L_Colon") %></td>
           	<td>
				<custom:write name="zmylagreementconfiginfo" property="createdate" dataType="date" dataFormatName="dateformat"/>
           	</td>
            <td class="td-text" width="110" ><%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %></td>
            <td>
                <custom:write dictType="Status"  name="zmylagreementconfiginfo" property="status"    />
            </td>

          </tr>
          <tr>
          <td class="td-text"width="110" ><%= label.getLabelName("L_Comments") + label.getLabelName("L_Colon") %></td>
          <td colspan="3" >

                <custom:textarea  readonly="true" name="zmylagreementconfiginfo" property="comments" cols="120" rows="4" />
               </td>

          </tr>
          <tr>
	             <td class="td-text" height="20"><%= label.getLabelName("L_ProdGroupName") %><%= label.getLabelName("L_Colon") %></td>
                          <td colspan="3">
                             &nbsp;<custom:write name="zmylagreementconfiginfo" property="productgroupname"  />

                          </td>
          </tr>

           <%}else{%>

            <tr>

          <td class="need" width="110" ><%= label.getLabelName("L_ZMYLAgreementConfigCode") + label.getLabelName("L_Colon") %></td>
          	<td>
                  <%	if(isNew!=null && isNew.equals("Y")){%>
                  <custom:text name="zmylagreementconfiginfo" property="agreementconfigcode" command="notnull"  label="L_ZMYLAgreementConfigCode" />
          	      <%}else{%>
                  <custom:text  readonly="true" name="zmylagreementconfiginfo" property="agreementconfigcode" command="notnull"  label="L_ZMYLAgreementConfigCode"/>
                  <%}%>
               </td>
             <td class="need" width="110" ><%= label.getLabelName("L_ZMYLAgreementConfigName") + label.getLabelName("L_Colon") %></td>
            <td>
				<custom:text  name="zmylagreementconfiginfo" property="agreementconfigname" command="notnull"  size="20" label="L_ZMYLAgreementConfigName" />
           	</td>
          </tr>

          <tr>

           	<td  class="need" width="110" ><%= label.getLabelName("L_ZMYLFirstOrgType") + label.getLabelName("L_Colon") %></td>
           	<td>
				   <custom:selectdic name="zmylagreementconfiginfo" property="sellertype" defaultValue="----ALL-----" defaultValueCost="99"   dictType="BuyerType" command="notnull" label="L_ZMYLFirstOrgType" />
            </td>
            <td class="need" width="110" ><%= label.getLabelName("L_ZMYLSecondOrgType") + label.getLabelName("L_Colon") %></td>
            <td>
                <custom:selectdic name="zmylagreementconfiginfo" property="buyertype" dictType="BuyerType" defaultValue="----ALL-----" defaultValueCost="99" command="notnull" label="L_ZMYLSecondOrgType" />
            </td>

          </tr>
           <%	if((isNew.equals("N")) || (isNew.equals("Y"))){%>
           <tr>
               <td  class="need" width="110" ><%= label.getLabelName("L_FirstOrg")+label.getLabelName("L_Chain") +label.getLabelName("L_Type") + label.getLabelName("L_Colon") %></td>
           	<td>
			<input type="checkbox" name="isusr0" <%=JspHelper.filterNull( issellerchaintypeChecked )%> class="normalradio"  onclick="javascript:checkboxValue('issellerchaintype')">
              <% if ( strIsNew.equalsIgnoreCase("no") ) 
             { %>
              <input type="hidden" name="issellerchaintype" value="<%=JspHelper.filterNull( issellerchaintype )%>">
          <% }
             else
             { %>
              <input type="hidden" name="issellerchaintype" value="N">
          <% } %> 
            </td>
            <td class="need" width="110" ><%= label.getLabelName("L_SecondOrg")+label.getLabelName("L_Chain") +label.getLabelName("L_Type")  + label.getLabelName("L_Colon") %></td>
            <td>
                  <input type="checkbox" name="isusr1" <%=JspHelper.filterNull( isbuyerchaintypeChecked )%> class="normalradio"  
                   onclick="javascript:checkboxValue('isbuyerchaintype')" >
            </td>
<% if ( strIsNew.equalsIgnoreCase("no") ) 
             { %>
              <input type="hidden" name="isbuyerchaintype" value="<%=JspHelper.filterNull( isbuyerchaintype )%>">
          <% }
             else
             { %>
              <input type="hidden" name="isbuyerchaintype" value="N">
          <% } %> 
          </tr>
           <%}%>
          <tr>

	        <td  class="need" width="110" ><%= label.getLabelName("L_ZMYLStartDate") + label.getLabelName("L_Colon") %></td>
		    <td>
	                <custom:text property="startdate"  dataType="date"  module="IMG" size="15" name="zmylagreementconfiginfo" command="notnull" label="L_ZMYLStartDate"/>
	              <a onclick="javascript:c.show(this,'cform.startdate','yyyy-MM-dd');"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
	        </td>
	        <td class="need" width="110" ><%= label.getLabelName("L_ZMYLExpireDate") + label.getLabelName("L_Colon") %></td>
		    <td>
	                <custom:text property="expiredate"  dataType="date"  module="IMG" size="15" name="zmylagreementconfiginfo" command="notnull" label="L_ZMYLExpireDate"/>
	              <a onclick="javascript:c.show(this,'cform.expiredate','yyyy-MM-dd');"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
	        </td>

<!-- 
           	<td  class="need" width="110" ><%= label.getLabelName("L_ZMYLStartDate") + label.getLabelName("L_Colon") %></td>
           	<td>
				<input  type="text" name="startdate0" isnull="N" label="<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_SlipDate",false)) %>"  value="<custom:write  property = "startdate" name="zmylagreementconfiginfo" dataType="date" dataFormatName="dateformat"/>" size="20" onBlur="javascript:startdate.value=dateCheck(startdate0.value, 'yyyy-MM-dd', '<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>');if(startdate.value<0){alert('<%= message.getMessageDesc("VALUE_MUST_BE_DATE",label.getLabelName("L_ZMYLStartDate",false)) %>');startdate0.focus();}">
                             <custom:hidden  property = "startdate" name="zmylagreementconfiginfo" command="notnull" label="L_ZMYLStartDate"    dataType="date" dataFormatName="dateformat"/>
                             <a onClick="show_calendar('cform.startdate0','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>')"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>

           	</td>
            <td class="need" width="110" ><%= label.getLabelName("L_ZMYLExpireDate") + label.getLabelName("L_Colon") %></td>
            <td>
                 <input  type="text" name="expiredate0" isnull="N" label="<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_SlipDate",false)) %>"  value="<custom:write  property = "startdate" name="zmylagreementconfiginfo" dataType="date" dataFormatName="dateformat"/>" size="20" onBlur="javascript:expiredate.value=dateCheck(expiredate0.value, 'yyyy-MM-dd', '<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>');if(expiredate.value<0){alert('<%= message.getMessageDesc("VALUE_MUST_BE_DATE",label.getLabelName("L_ZMYLExpireDate",false)) %>');expiredate0.focus();}">
                            <custom:hidden  property = "expiredate" name="zmylagreementconfiginfo"  command="notnull" label="L_ZMYLExpireDate" dataType="date" dataFormatName="dateformat"/>
                             <a onClick="show_calendar('cform.expiredate0','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>')"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>

            </td>
 -->


          </tr>

          <tr>

           	<td class="td-text" width="110" ><%= label.getLabelName("L_CreateTime") + label.getLabelName("L_Colon") %></td>
           	<td>
				<custom:write name="zmylagreementconfiginfo" property="createdate" dataType="date" dataFormatName="dateformat"/>
           	</td>
            <td class="need" width="110" ><%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %></td>
            <td>
                <%if(zmylagreementconfiginfo!=null && ((Integer)zmylagreementconfiginfo.get("status")).intValue() == 10){%>
                <custom:selectdic dictType="Status"  name="zmylagreementconfiginfo" property="status"  valueCriteria="10"  />
                <%}else{%>
                 <custom:selectdic dictType="Status"  name="zmylagreementconfiginfo" property="status"  />
                <%}%>
            </td>

          </tr>
          <tr>
          <td class="td-text"width="110" ><%= label.getLabelName("L_Comments") + label.getLabelName("L_Colon") %></td>
          <td colspan="3" >

                <custom:textarea name="zmylagreementconfiginfo" property="comments" cols="120" rows="4" />
               </td>

          </tr>
          <tr>
	             <td class="td-text" height="20"><%= label.getLabelName("L_ProdGroupName") %><%= label.getLabelName("L_Colon") %></td>
                          <td colspan="3">
                            &nbsp; <custom:hidden name="zmylagreementconfiginfo" property="prodgroupcode"  />
                            <input type="text" name="prodgroupname"   value="<custom:write name="zmylagreementconfiginfo" property="productgroupname"   />"    onchange="cleanid()"/>
                                 <a onclick='popWindowsContactProd()'>  <custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
                            <custom:hidden name="zmylagreementconfiginfo" property="zmylprodgroupid" />
                          </td>
          </tr>

           <%}%>
        </table>
      </td>
    </tr>
    <tr>
      <td class="summary_top"></td>
    </tr>
    <tr>
    <td height="49" class="td_center">

         <%if(zmylagreementconfiginfo!=null && ((Integer)zmylagreementconfiginfo.get("status")).intValue() == 10){%>
          <a onclick="page_submit()"><custom:button type="1" label="L_Submit1" imgsrc="back.gif" border="0" style="width:60" /></a>
          <%}%>
        <%	if(!viewflag.equals("view")){%>
        <a onclick="page_save()"><custom:button type="1" label="L_Save" imgsrc="back.gif" border="0" style="width:60" /></a>
        <%}%>
        <a onclick="javascript:page_back()"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a>


    </td>
    </tr>
</form>
</table>
<script language="JavaScript" src="../../js/Calendar.js" ></script>
<%@include file="/inc/AlertError.inc"%>
</body>
</html>


           		